﻿namespace Charades.Web.Helpers
{
	using System.Net.Mail;
	using System.Threading.Tasks;

	public static class MailHelper
	{
		public static void SendFeedback(string email, string content)
		{
			Task.Run(() => Send(email, content));
		}

		private static void Send(string email, string content)
		{
			using (var smtpClient = new SmtpClient("relay2.skydreams.ws"))
			{
				var mail = new MailMessage
				{
					From = new MailAddress(email)
				};

				mail.To.Add("artskf@gmail.com");
				mail.Subject = "drawpi.co feedback";
				mail.Body = content;

				smtpClient.Port = 2525;
				smtpClient.Credentials = new System.Net.NetworkCredential("", "");
				smtpClient.UseDefaultCredentials = false;
				smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;

				smtpClient.Send(mail);
			}
		}
	}
}